filenames = ['cats.txt', 'dogs.txt']

for filename in filenames:
    try:
        with open(filename, 'r') as f_object:
            file = f_object.read().rstrip()
            print("{} has \n{}".format(filename, file))
    except FileNotFoundError:
        #print("{} is not found.".format(filename))
        pass

books = 'Pride_and_Prejudice.txt'

with open(books, 'r') as f_obj:
    contents = f_obj.read()
    print(type(contents))
    #words = contents.split()
    #print(words)
    #print(type(words))
    #a = files.lower().count('the').
    #print(a)
    num = contents.count('the')
    num1 = contents.lower().count('the')
    print(num, num1)
